package com.alisls.demo.springcloud.service.user.client.oauth;

import com.alisls.demo.springcloud.common.model.dto.DataResult;
import com.alisls.demo.springcloud.service.user.dto.client.OAuthClientDetailDTO;
import com.alisls.demo.springcloud.service.user.dto.client.OAuthClientDetailPwdDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * OAuth客户端管理的Feign客户端
 *
 * @author Ke Wang
 * @date 2020/11/11
 */
@FeignClient(name = "demo-springcloud-2-oauth-server", contextId = "clientDetailFeignClient",
        path = "oAuthClientDetail")
public interface ClientDetailFeignClient {

    @GetMapping("/getByClientId/{clientId}")
    DataResult<OAuthClientDetailDTO> getByClientId(@PathVariable("clientId") String clientId);

    @PostMapping("/save")
    OAuthClientDetailPwdDTO save(@RequestBody OAuthClientDetailPwdDTO authClientDetailPwdDTO);

    @DeleteMapping("/removeById/{clientId}")
    Integer removeById(@PathVariable("clientId") String clientId);

}
